home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 09, No. 05 (1988-05)(MicroSPARC)(Side A).zip
/
Nibble Volume 09, No. 05 (1988-05)(MicroSPARC)(Side A).po
/
ALINER.PROGS.txt
next >
Wrap
Text File
|
1996-12-24
|
12KB
|
652 lines
Listing 3: AppleLiner programs
-----------------------------------------------------------
OUT PND
*** Mark cursor position with mark A
F##{CTRL-G}a#
YN
*** Switch to single window
YN
*** Prompt for outline level
PIN {CTRL-G}lOutline level (enter dashes):=$D
*** If no response then use 6 dashes
PCS/$D//
PAS------=$D
*** Return to cursor position with forward search direction
B
F#{CTRL-G}a##
YN
PPR{CTRL-G}l
*** Go to split screen, use lower cursor
YY
*** Insert mark 1 with leading dash after current line
F#%##
YN
P
F##%- {CTRL-G}1%#
YN
P
*** Delete outline, if any
PPR{CTRL-G}l==> Erasing old outline, if any....
*** Move back 3 CRs from end of file
E
F#%#%#
YYYYN
*** Look forward for end of outline
D
F#%- !!#
N
*** If found, go delete whole outline
PGO DEL0
*** Else done
PGO DEL1
DEL0 D
*** Back up one line
F#%#%#
YN
*** Find end of document
F#%- !!#
N
PGO DEL
PGO DEL1
*** Delete all characters
DEL D
F##A
*** Return to cursor position
DEL1 P
*** Insert outline title line at end of file
E
F##%- !! END OF DOCUMENT !!%%%%%%%%%#
YN
*** Put carriage return at beginning
B
F##%#
YN
*** Mark all headlines
PPR{CTRL-G}l==> Creating new outline....
B
F#%-#%{CTRL-G}a-#A
P
*** Copy (direct load) to end of file all headlines
E
L##{CTRL-G}a#%#A
P
*** Remove all mark A's
B
F#{CTRL-G}a##A
P
*** Go to the beginning of the outline
PPR{CTRL-G}l==> Cleaning up outline....
B
F#%- !!#
N
*** Delete all lines that have more leading dashes than
*** desired
F#%-$D$%##A
P
*** Go to first outline headline
B
F#%- !!#%- !!#
YN
F#%-#
N
*** Delete all double carriage returns
F#%%-#%-#A
P
*** Remove CR at beginning
PPR{CTRL-G}l==> Finishing up....
B
F#%##
YN
*** Find and delete both mark 1's, leave cursor at second
*** (in outline)
F#%- {CTRL-G}1##
YYYN
P
PYD
*** Switch to cursor in top screen
Y
PQT
-----------------------------------------------------------
DELOUT PND
*** Mark cursor position
F##{CTRL-G}a%#
YN
PDO DELO
-----------------------------------------------------------
DELO PND
*** Delete outline, if any
PPR{CTRL-G}l==> Erasing outline, if any....
*** Move back 3 CRs from end of file
E
F#%#%#
YYYYN
*** Look forward for end of outline
D
F#%- !!#
N
*** If found, go delete whole outline
PGO DEL0
*** Else done
PGO DEL1
DEL0 D
*** Back up one line
F#%#%#
YN
*** Find end of document
F#%- !!#
N
PGO DEL
PGO DEL1
*** Delete all subsequent characters
DEL D
F##A
*** Return to cursor position
DEL1 B
F#{CTRL-G}a%##
YN
P
*** Unsplit screen
Y
Y
YN
PQT
-----------------------------------------------------------
FIND PND
*** Mark cursor position
F##{CTRL-G}a#
YN
*** Return to position, backward direction
E
F#{CTRL-G}a##
YN
*** Put a mark at beginning of line
F#%#%{CTRL-G}a#
YN
*** Put the line into string $A
PLS##%{CTRL-G}a#%#N=$A
*** Search forward from the beginning of the file to find
*** matching string
B
F/$A/
N
*** Get cursor into lower window
YY
*** Remove the mark
F#{CTRL-G}a##
YN
*** Turn on display
PYD
*** Switch to upper window and cursor
Y
PQT
-----------------------------------------------------------
MARK P
*** Undo split screen, if any
YN
*** Turn off display
PND
*** Mark cursor position
F##{CTRL-G}a#
YN
*** Remove any existing marks
PPR{CTRL-G}l==> Removing any existing marks....
B
F#{CTRL-G}&%##A
P
*** Put carriage return at beginning
B
F##%#
YN
*** Come back to cursor position with forward search
*** direction
F#{CTRL-G}a##
YN
*** Move backward one character
D
F#
YN
*** Write message
PPR{CTRL-G}l==> Marking....
*** Search backward, place mark 1 at beginning of nearest
*** headline
F#%-#%{CTRL-G}1%-#
YN
*** If a headline was found, preceeded by carriage-return
*** then go on
PGO HOK
*** Else put mark 1 at beginning of file
F##%{CTRL-G}1#
YN
*** Set headline level $A to maximum
PAS------=$A
PGO MK1
*** Compute headline level
HOK PLS##{CTRL-G}1%# #N=$A
*** Move cursor forward just beyond mark
MK1 B
F#{CTRL-G}1%#{CTRL-G}1%#
YN
*** Look for next headline and mark it with mark 2
HEAD F#%-#%{CTRL-G}2%-#
YN
*** If a headline was found, then go check its level
PGO CHECK
*** Else put mark 2 at end of file, and go on the exit
*** routine
F##{CTRL-G}2%#
YN
PGO EXIT
*** Back up before mark
CHECK D
F#{CTRL-G}2%#
N
D
*** Remove mark if marked headline has more dashes than
*** starting headline
F#{CTRL-G}2%$A-#$A-#
YN
*** And then proceed to next headline
PGO HEAD
*** Else marking is done, so exit
EXIT B
*** Remove initial carriage return
F#%##
YN
*** Position cursor at beginning of marked text
F#{CTRL-G}1%#{CTRL-G}1%#
N
*** Turn display back on
PYD
*** Return to routine MOTE if $C is MOTE
PCS/$C/MOTE/
PDO $C
PQT
-----------------------------------------------------------
UNMARK PND
*** Mark cursor location
F##{CTRL-G}a#
YN
*** Remove all marks and following carriage-return
PPR{CTRL-G}l==> Removing marks....
B
F#{CTRL-G}&%##A
P
*** Return to original cursor position
B
F#{CTRL-G}a##
YN
*** Turn display back on and quit
PQT
-----------------------------------------------------------
MOVE PND
*** Copy everything between marks to cursor location
PPR{CTRL-G}l==> Copying material....
L##{CTRL-G}1%#{CTRL-G}2#N
*** Go delete moved material
PDO DELETE
-----------------------------------------------------------
COPY PND
*** Copy everthing between marks to cursor location
PPR{CTRL-G}l==> Copying material....
L##{CTRL-G}1%#{CTRL-G}2#N
P
*** Mark cursor position
F##{CTRL-G}a%#
YN
*** Remove marks
B
F#{CTRL-G}#A
P
*** Delete outline, if any
PDO DELO
-----------------------------------------------------------
DELETE PND
*** Mark cursor position
F##{CTRL-G}a%#
YN
*** Find mark 2
E
F#{CTRL-G}2#
N
*** If mark 2 exists, go on
PGO LOOP
*** Else nothing to delete, so exit
PGO ERROR
*** Search backward for mark 1
LOOP F#{CTRL-G}1#
N
PGO DELOK
*** If no mark found then deletion is done
PGO DELDONE
*** Print message
DELOK PPR{CTRL-G}l==> Deleting ...
*** Forward direction
D
*** Find mark 2
F#{CTRL-G}2#
N
*** Reverse direction
D
*** Delete a paragraph
X
*** Go back and delete some more
PGO LOOP
*** Remove mark 2
DELDONE D
F#{CTRL-G}2##
YN
*** Erase old outline
PDO DELO
*** Error exit
ERROR PPR {CTRL-G}lMarks missing or not in order.
PIN (Press RETURN)
*** Restore cursor position
B
F#{CTRL-G}a##
YN
P
PQT
-----------------------------------------------------------
PROMOTE PND
*** Set up return to MOTE when done with marking
PASMOTE=$C
*** Set up for deleting a dash
PAS=$D
*** Go mark text; do MOTE when done
PDO MARK
-----------------------------------------------------------
DEMOTE PND
*** Set up return to MOTE when done with marking
PASMOTE=$C
*** Set up for adding a dash
PAS--=$D
*** Go mark text; do MOTE when done
PDO MARK
-----------------------------------------------------------
MOTE PND
*** Erase string $C
PAS=$C
*** Put cursor at mark 1
F#{CTRL-G}1#{CTRL-G}a#
YN
PGO MOK
*** If mark 1 doesn't exist, just exit
PQT
MOK PPR{CTRL-G}l==> Adjusting headline levels....
*** Move mark 1 to next headline
LOOP F#%-#%{CTRL-G}1%-#
YN
P
*** Check if beyond mark 2
F#{CTRL-G}2#
N
*** If not, go back and adjust
PGO MADJ
*** If so then done
PGO MDONE
MADJ D
*** Adjust dashes at mark 1
F#{CTRL-G}1#
N
D
F#{CTRL-G}1%-#$D#
YN
PGO LOOP
MDONE B
*** Remove marks
F#{CTRL-G}&%##
YYYN
P
*** Erase outline
PDO DELO
-----------------------------------------------------------
POUT PND
*** Look for outline section
B
F#%- !!#%- !!#
YN
*** If found, go on
PGO POUT1
*** Else print message and exit
PIN{CTRL-G}lNo outline exists (press RETURN)
PGO POUT2
POUT1 P
*** Turn on printing at outline, after formfeed
PPR{CTRL-G}l==> Marking outline for printing....
F#%-#%.ff%.ep1%-#
YN
P
*** Turn off printing at beginning of document
B
F##.ep0%#
YN
*** Print it
PPR{CTRL-G}l==> Printing....
PNP
*** Remove printing commands
PPR{CTRL-G}l==> Restoring document
B
F#.ep0%##
YN
F#.ff%.ep1%##
YN
P
*** Reposition cursor
POUT2 B
*** Turn on display and quit
PQT
-----------------------------------------------------------
PTXT PND
*** Get headline level for printing
PIN{CTRL-G}lOutline level to print? (enter dashes):=$D
*** Insert CR at beginning of file
B
F##%#
YN
*** Make comments of all lower level headlines
PPR{CTRL-G}l==> Removing unneeded headlines....
B
F#%$D-#%. $D-#A
P
*** Restore headlines which are also text
B
F#%. - "#%. - "{CTRL-G}a%#A
P
B
F#%. -- "#%. -- "{CTRL-G}a%#A
P
B
F#%. --- "#%. --- "{CTRL-G}a%#A
P
B
F#%. ---- "#%. ---- "{CTRL-G}a%#A
P
B
F#%. ----- "#%. ----- "{CTRL-G}a%#A
P
B
F#%. ------ "#%. ------ "{CTRL-G}a%#A
P
*** Turn off printing of outline, if any
OUTOFF B
F#%- !!#%.ep0%- !!#
YN
P
*** Print
PPR{CTRL-G}l==> Printing....
PNP
PPR{CTRL-G}l==> Restoring document...
*** Fix up text headlines
B
F#"{CTRL-G}a%#"#A
P
*** Remove comments
B
F#. -#-#A
P
*** Remove print disable
E
F#.epo%##A
P
*** Remove extra CR at beginning
B
F#%##
YN
*** Turn on display and quit
PQT
-----------------------------------------------------------
SOUT PND
*** Look for outline section
PPR{CTRL-G}lLooking for outline....
B
F#%- !!#%- !!#
YN
*** If found, go on
PGO SOUT1
*** Else print message and exit
PIN{CTRL-G}lNo outline exists (press RETURN)
PGO SOUT2
*** Get saving file name
SOUT1 PIN {CTRL-G}lFilename for saving outline? =$B
*** If none, exit
PCS/$B//
PGO SOUT2
P
*** Go to first headline of outline
F#%-#
N
P
*** Save segment to end of outline
PPR{CTRL-G}l==> Saving outline into $B ....
S$B#!!%#
YES
SOUT2 B
*** Turn display back on and quit
PQT
-----------------------------------------------------------
STXT PND
*** Print warning message
PPR {CTRL-G}l Note:{CTRL-G}l
PPR This command will erase your
PPR document in memory.
PIN Have you saved it? (Y/N) =$A
*** Check for yes answer to query
PCS/$A/Y/
PGO STXT1
PCS/$A/y/
PGO STXT1
PGO STXT2
*** Get saving file name
STXT1 PIN{CTRL-G}l File for saving text? =$B
*** If none, exit
PCS/$B//
PGO STXT2
*** Get headline level to save
PIN{CTRL-G}lHeadline level to save? (enter dashes):=$D
*** Find and erase outline section
PPR{CTRL-G}l==> Erasing old outline, if any....
*** Move back 3 CRs from end of file
E
F#%#%#
YYYYN
*** Look forward for end of outline
D
F#%- !!#
N
*** If found, go delete whole outline
PGO DEL0
*** Else done
PGO DEL1
*** Find end of document
DEL0 D
F#%- !!#
YN
PGO DEL
PGO DEL1
*** Delete all characters
DEL D
F##A
DEL1 P
*** Put carriage return at start
B
F##%#
YN
*** Mark headlines of lower level
PPR{CTRL-G}l==> Removing unneeded headlines....
B
F#%$D-#%{CTRL-G}a$D-#A
P
*** Restore text headlines
PPR{CTRL-G}l==> Restoring text headlines
B
F#{CTRL-G}a- "##A
P
B
F#{CTRL-G}a-- "##A
P
B
F#{CTRL-G}a--- "##A
P
B
F#{CTRL-G}a---- "##A
P
B
F#{CTRL-G}a----- "##A
P
B
F#{CTRL-G}a------ "##A
P
*** Delete marked headlines
B
F#{CTRL-G}a$%##A
P
*** Remove initial carriage return
B
F#%##
YN
*** Save what's left
PPR{CTRL-G}lSaving into $B ....
S$B
YES
*** Clear buffer
NY
*** Go to single window
STXT2 Y
YN
*** Turn on display and quit
PQT
-----------------------------------------------------------